import React, { memo, useState, useEffect, useRef, useCallback } from "react";
import { useDispatch, useSelector, shallowEqual } from "react-redux";
import { Route, Link, useHistory } from "react-router-dom";
import storage from "@/utils/storage";

import { UserCollectWrapper } from "./style";
import { getArticleFav } from "@/service/article";
import Article from "./article";
export default memo(function UserCollect() {
  const [articleFavs, setarticleFavs] = useState([])
  const [page, setpage] = useState(1);

  useEffect(() => {
    const token = storage.get("token");
    let obj = {
      token,
      page,
    };

    getArticleFav(obj).then((res) => {
      console.log(res);
      setarticleFavs(res.data);
    });
  }, []);

  return (
    <UserCollectWrapper>
      
      <Article articleFavs={articleFavs}></Article>
    </UserCollectWrapper>
  );
});
